package org.wikinews.controller;

import java.util.List;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.wikinews.model.Post;
import org.wikinews.repo.PostRepo;

@Name("rssCtrl")
@Scope(ScopeType.EVENT)
public class RssCtrl {
	
	@In
	private PostRepo postRepo;

	private List<Post> postList;

	public List<Post> getPostList() {
		if (postList == null) {
			postList = postRepo.getAll();
		}
		return postList;
	}
	
}
